package server.business.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import server.business.converter.BackBloodReasonConverter;
import server.business.converter.StateConverter;


import java.io.Serializable;
import java.util.Date;

/**
 * 血液退回血站信息表
 *
 * @author Galaxy
 * @TableName return_blood_station
 */
@TableName(value = "return_blood_station")
@Data
public class ReturnBloodStation implements Serializable {
    /**
     * 编号
     */
    @ExcelProperty("编号")
    @ColumnWidth(10)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 创建时间
     */
    @ExcelIgnore
    @TableField(value = "gmt_create")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtCreate;

    /**
     * 修改时间
     */
    @ExcelIgnore
    @TableField(value = "gmt_modified")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtModified;

    /**
     * 退血单号
     */
    @ExcelProperty("退血单号")
    @ColumnWidth(10)
    @TableField(value = "back_information_number")
    private String backInformationNumber;

    /**
     * 退血原因
     */
    @ExcelProperty(value = "退血原因", converter = BackBloodReasonConverter.class)
    @ColumnWidth(10)
    @TableField(value = "back_blood_reason")
    private String backBloodReason;

    /**
     * 血液信息
     */
    @ExcelIgnore
    @TableField(value = "blood_information")
    private String bloodInformation;

    /**
     * 申请人姓名
     */
    @ExcelProperty("申请人姓名")
    @ColumnWidth(10)
    @TableField(value = "applicant_name")
    private String applicantName;

    /**
     * 申请人工号
     */
    @ExcelProperty("申请人工号")
    @ColumnWidth(10)
    @TableField(value = "applicant_number")
    private String applicantNumber;

    /**
     * 申请时间
     */
    @ExcelProperty("申请时间")
    @ColumnWidth(20)
    @TableField(value = "apply_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date applyTime;

    /**
     * 状态
     */
    @ExcelProperty(value = "状态", converter = StateConverter.class)
    @ColumnWidth(10)
    @TableField(value = "state")
    private String state;

    /**
     * 审核人姓名
     */
    @ExcelProperty("审核人姓名")
    @ColumnWidth(10)
    @TableField(value = "auditor")
    private String auditor;

    /**
     * 审核时间
     */
    @ExcelProperty("审核时间")
    @ColumnWidth(20)
    @TableField(value = "audit_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date auditTime;

    /**
     * 审核人工号
     */
    @ExcelProperty("审核人工号")
    @ColumnWidth(10)
    @TableField(value = "auditor_number")
    private String auditorNumber;

    /**
     * 血液ID
     */
    @ExcelProperty("血液ID")
    @ColumnWidth(10)
    @TableField(value = "blood_id")
    private String bloodId;

    /**
     * 1代表已删除，0代表未删除
     */
    @ExcelIgnore
    @TableLogic
    @TableField(value = "is_deleted")
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = -8329756524125723227L;
}